package com.kerrykidz.filemanagement.dao.model;

import java.text.ParseException;
import java.util.Date;

import com.kerrykidz.system.util.DateUtil;
import com.rdp.framework.exception.RDPException;
import com.rdp.util.time.DateFormatUtil;

public class HisOrderEntity {
	private String fkOrderId;
	private Double amount;
	private String fkAccount;
	private Date payTime;
	private String payContent;
	private String pkMemId;
	private String memName;
	private Date validFrom;
	private Date validTo;
	private int cnt;
	private String pkMemClassId;
	
	public String getPkMemClassId() {
		return pkMemClassId;
	}
	public void setPkMemClassId(String pkMemClassId) {
		this.pkMemClassId = pkMemClassId;
	}

	//商品数量
    private int prdCount;
    //商品名称
    private String prdName;
    //商品ID
    private String pkPrdId;
    //购买类型
    private String hisType;
    //成人票数量
    private int chdCnt;
	
	public int getChdCnt() {
		return chdCnt;
	}
	public void setChdCnt(int chdCnt) {
		this.chdCnt = chdCnt;
	}
	public String getHisType() {
		return hisType;
	}
	public void setHisType(String hisType) {
		this.hisType = hisType;
	}
	public int getPrdCount() {
		return prdCount;
	}
	public void setPrdCount(int prdCount) {
		this.prdCount = prdCount;
	}
	public String getPrdName() {
		return prdName;
	}
	public void setPrdName(String prdName) {
		this.prdName = prdName;
	}
	public String getPkPrdId() {
		return pkPrdId;
	}
	public void setPkPrdId(String pkPrdId) {
		this.pkPrdId = pkPrdId;
	}

	private String payTimePage;
	private String validFromPage;
	private String validToPage;
	
	public String getFkOrderId() {
		return fkOrderId;
	}
	public void setFkOrderId(String fkOrderId) {
		this.fkOrderId = fkOrderId;
	}
	public Double getAmount() {
		return amount;
	}
	public void setAmount(Double amount) {
		this.amount = amount;
	}
	public String getFkAccount() {
		return fkAccount;
	}
	public void setFkAccount(String fkAccount) {
		this.fkAccount = fkAccount;
	}
	public Date getPayTime() {
		return payTime;
	}
	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}
	public String getPayContent() {
		return payContent;
	}
	public void setPayContent(String payContent) {
		this.payContent = payContent;
	}
	public String getMemName() {
		return memName;
	}
	public void setMemName(String memName) {
		this.memName = memName;
	}
	public String getPkMemId() {
		return pkMemId;
	}
	public void setPkMemId(String pkMemId) {
		this.pkMemId = pkMemId;
	}
	public Date getValidFrom() {
		return validFrom;
	}
	public void setValidFrom(Date validFrom) {
		this.validFrom = validFrom;
	}
	public Date getValidTo() {
		return validTo;
	}
	public void setValidTo(Date validTo) {
		this.validTo = validTo;
	}
	public int getCnt() {
		return cnt;
	}
	public void setCnt(int cnt) {
		this.cnt = cnt;
	}
	
	public void setPayTimePage(String payTimePage) throws ParseException {
		this.payTimePage = payTimePage;
		try {
			payTimePage=DateUtil.formatStrToStr(payTimePage, "yyyy-MM-dd HH:mm:ss.0", "yyyy-MM-dd");
			this.payTime = DateFormatUtil.convertStrToDate(payTimePage, "yyyy-MM-dd");
		} catch (RDPException e) {
			e.printStackTrace();
		}
	}
	
	public String getPayTimePage() {
		if (this.payTime != null) {
			return DateFormatUtil.format(this.payTime, "yyyy.MM.dd");
		}
		return "";
	}
	public void setValidFromPage(String validFromPage) throws ParseException {
		this.validFromPage = validFromPage;
		try {
			validFromPage=DateUtil.formatStrToStr(validFromPage, "yyyy-MM-dd HH:mm:ss.0", "yyyy-MM-dd");
			this.validFrom = DateFormatUtil.convertStrToDate(validFromPage, "yyyy-MM-dd");
		} catch (RDPException e) {
			e.printStackTrace();
		}
	}
	
	public String getValidFromPage() {
		if (this.validFrom != null) {
			return DateFormatUtil.format(this.validFrom, "yyyy.MM.dd");
		}
		return "";
	}
	public void setValidToPage(String validToPage) throws ParseException {
		this.validToPage = validToPage;
		try {
			validToPage=DateUtil.formatStrToStr(validToPage, "yyyy-MM-dd HH:mm:ss.0", "yyyy-MM-dd");
			this.validTo = DateFormatUtil.convertStrToDate(validToPage, "yyyy-MM-dd");
		} catch (RDPException e) {
			e.printStackTrace();
		}
	}
	
	public String getValidToPage() {
		if (this.validTo != null) {
			return DateFormatUtil.format(this.validTo, "yyyy.MM.dd");
		}
		return "";
	}
}